package com.mdxx.xczd.db.helper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ServerDBHelper extends SQLiteOpenHelper {

	private static final String DB_NAME = "server.db";
	private static final int VERSION = 1;
	
	private static final String CREATE_TABLE_LOCATION_SQL ="create table location(" +
			"_id integer  primary key autoincrement, " +
			"location varchar(500),"+
			"issend integer"+ 
			")";
	
	private static final String CREATE_TABLE_PHOTO_SQL ="create table photo(" +
			"_id integer  primary key autoincrement, " +
			"photo varchar(100), "+
			"ptime varchar(16),"+
			"lo double,"+
			"la double"+
			")";
	
	private static final String CREATE_TABLE_FILE_SQL ="create table file(" +
			"_id integer  primary key autoincrement, " +
			"file varchar(1000)"+
			")";
	
	private static final String CREATE_TABLE_VIDEO_SQL ="create table video(" +
			"_id integer  primary key autoincrement, " +
			"video varchar(255), "+
			"issend integer"+ 
			")";
		
	public ServerDBHelper(Context context) {
		super(context, DB_NAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_TABLE_LOCATION_SQL);
		db.execSQL(CREATE_TABLE_PHOTO_SQL);
		db.execSQL(CREATE_TABLE_FILE_SQL);
		db.execSQL(CREATE_TABLE_VIDEO_SQL);
	}

	@Override
	public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {

	}

}
